<?php
 include_once '../../common/sql.php';
 $conn=connect();
 $sql="select * from categories ";
$arr=query($conn,$sql);
$res=array(
    "code"=>0,
    "msg"=>'请求失败'
);
if($arr){
    $res['code']=1;
    $res['data']=$arr;
    $res['msg']='请求成功';
}
echo json_encode($res);

?>